/**
 * 
 */
package com.edu.lawdoc.api.utils;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;


/**
 * @author xiao.hu
 *
 */
public class LoggerKit {
	static Logger log = LogManager.getLogger(LoggerKit.class);
	
	public static void debug(String logTextTemplate, Object... params) {
		String logText = String.format(logTextTemplate, params);
		log.debug(logText);
	}
	
	public static void info(String logTextTemplate, Object... params) {
		String logText = String.format(logTextTemplate, params);
		log.info(logText);
	}
	
	public static void error(Exception e) {
		e.printStackTrace();
		String fullStackTrace = org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e);
		error(fullStackTrace);
	}
	
	public static void error(String error) {
		log.error(error);
	}
	
	public static void error(String logTextTemplate, Object... params) {
		String logText = String.format(logTextTemplate, params);
		error(logText);
	}
}
